home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / General / ViewIt™ 2.24 Shareware / FaceWare / FaceWare.rsrc / TEXT_1902_HelpCt.txt < prev    next >
Text File  |  1994-04-10  |  7KB  |  43 lines

  1. HelpCt‚Ñ¢ 2.2 Guide
  2.   The HelpCt driver supports controls that display and edit styled "help" text.  FaceWare makes extensive use of this control type to provide on-line help.  Note that HelpCt controls are not well-suited to display user-editable text.  To do the latter, use BaseCt's editable text controls, or the TextCt or StylCt controls included with the EditControls product.
  3.  
  4. Basic Operation
  5.   The current text displayed in a HelpCt control is obtained from the TEXT/styl resource pair that has a resource ID number equal to the control's value.  Both SetVal and SetCtlValue can be used to reset this value and thereby "flip" between blocks of text.
  6.   In many cases you will not need to display more than one text block in a HelpCt control, and you can simply set the control's min = max = value to the resource ID of a single TEXT/styl pair.
  7.   For proper operation, the control should be of type Editable, Return keys should be accepted, and Idle messages should be sent to the control.  The control's value is used for data linking.  No use is made of the resource type and ID fields.  HelpCt controls look best with solid bodies, one-pixel frames, and no indent.
  8.   The TEHandle associated with a HelpCt control can be found in cHiData after calling GetCtl to get control information.
  9.  
  10. Auto-Scrolling
  11.   The default behavior of the Enter key is to hit the default control (= the close box in this window).  If you would prefer to have the Enter key auto-scroll to the current selection, then check the "Enter" item in the "Keys Accepted" menu so that the Enter key gets passed to the HelpCt control.
  12.  
  13. Read Only Text
  14.   The lock icon seen at the top, right of this window can be used to toggle between locked (= read only) and unlocked (= editable) states.  If you prefer to display text that can never be edited by the user, then add 2 to the control's VarCode.  In this case the lock icon will not appear, and the help text will be "Read Only".
  15.  
  16. Multiple Topics
  17.   HelpCt supports standard items 1901-1990 which can be used to switch topics in response to menu selections.  When receiving a message from such a standard item, HelpCt calculates a resource ID using the following formula,
  18.   res ID = standard label number - 1901 + control min
  19. and loads the corresponding TEXT/styl resources.
  20.   For example, to support the selection of topics corresponding to TEXT/styl resources 1051 to 1060, you would set the HelpCt control's min and max values to 1051 and 1060, respectively, and then create a menu with items labeled from 1901 to 1910 (e.g. "MyItem#1901").  Each selection from this menu would then cause HelpCt to load the corresponding TEXT/styl resources.
  21.  
  22. SubTopics Menu
  23.   Each HelpCt control has a default style that can be set using ViewIt's Style menu when in editing mode.  If this default style is not plain, then HelpCt uses it to build a subtopics menu by searching the help text for all strings that match the control's default style.
  24.   The subtopics menu created by HelpCt has a menuID equal to 255 and can be attached to any hierarchical menu item (see the "Subtopic" item above), and is also automatically attached to the standard item (if any) associated with the control's current value.  A control with Min = 1051, Max = 1060, and Value = 1053, for example, would have its suptopics menu attached to the standard item with label #1903.
  25.  
  26. Hierarchical Topics   (Advanced Option)
  27.   In the case where the help topics for a single control can be arranged into groups of subtopics, you can get HelpCt to automatically build the corresponding hierarchical help menus by setting the control's VarCode equal to one.
  28.   To build these help menus, HelpCt searches for all TEXT/styl resource pairs with resource IDs between the control's min and max values.  One help menu is allocated for each contiguous block of resource IDs (i.e. skip one or more resource ID numbers to force a new menu to be created).  The help items in each menu consist of the resource names of the associated TEXT/styl resources.
  29.   The hierarchical help menus will have menuIDs from 236-253, and each help item is a standard HelpCt menu item labeled from 1901-1990 (as described above).  A new set of menus is allocated for each HelpCt control, and these menus are only inserted when the control is selected, so conflicts between HelpCt controls will never occur.
  30.   The only additional work needed to make use of these hierarchical menus is to provide access to them.  This is easily done by creating another menu which has hierarchical menu items linked to the hierarchical help menus (236-253).
  31.  
  32. Creating New Help
  33.   If you create a new HelpCt control and associate it with a non-existing TEXT/styl resource pair, then HelpCt will display a message that the resources are missing and allow you to enter new text.  You can then save this text to the current resource file using the standard "Save" menu item (vs. the "Save All to disk" item which saves the FWND template).
  34.   An alternative way to create new help text is to use ResEdit to create TEXT/styl resources which can later be associated with HelpCt controls and further edited.
  35.   Warning:  The current version of HelpCt does not track whether the text in the control is "dirty" due to editing, so save your changes before switching topics or closing the window!
  36.  
  37. Standard Menu Items
  38.   The standard items which appear in this window's menus are supported by HelpCt (Save, Revert, ..., Next Case).  HelpCt also supports the standard "Go To" item which it renames "Next Topic" to switch main topics (see the ViewIt Help for an example).  ViewIt's Font, Size, Style, and Color menus are also supported.
  39.   When printing via the "Print..." standard item, HelpCt resets the parent window's title to the name of the TEXT resource being printed, and prints the name of this resource and a page # at the top of each page.  "Print All..." prints all of the TEXT/styl resources associated with the control (resID = min to max).
  40.  
  41. Limitations
  42.   All limitations of Apple's TextEdit (such as 32K per text block) apply.  No support for hand scrolling.  No more than 18 hierarchical help menus and 90 help items are created per HelpCt control.  The global hilite color is always used whether that option is checked or not.
  43.   The line height is constant within each text block and is determined by the height of the control's current font and font size.  Thus, for example, to change the line height of the text you are now reading, enter edit mode and reset this control's font size.